/**
 * 
 */
package tests.acceptanceTests;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import sourceFiles.Application;
import sourceFiles.CentralComputer;

/**
 * @author LASO-TEAM
 * 
 *         This test that we can buy a regular ticket for a child.
 * 
 */
public class AcceptanceTest8 extends AcceptanceTests {


	/**
	 * @throws java.lang.Exception
	 */
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		// this initializes the relevant classes for this test.
		String currentPath = new java.io.File(".").getCanonicalPath();
		currentPath = currentPath + IN_PROJECT_PATH_TO_TESTS;
		masterXMLFilePath = currentPath + "\\input\\TestsMaster8.xml";
		copyXMLFilePath = currentPath + "\\results\\AcceptanceTests8Result.xml";
	}

	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		copySourceFile();
		centralComputer = new CentralComputer(copyXMLFilePath);
		application = new Application(centralComputer);
		password = centralComputer.addGuardian(IDs[0], billingInfo);
		centralComputer.addChildToGuardian(IDs[0], IDs[1], AGE, HEIGHT);
	}

	@Test
	public void test() {
		try {
			application.login(IDs[0], password);
			application.buyTicket(1, IDs[0], IDs[1]);
		} catch (Exception e) {
			fail("supposed to succeed. " + e.getClass().toString());
		}
	}

}
